package top.goldenyear.porpoise.framework.gateway;

import top.goldenyear.porpoise.framework.security.core.filter.AppAuthFilter;
import top.goldenyear.porpoise.framework.web.core.filter.AppExceptionFilter;
import top.goldenyear.porpoise.framework.web.core.filter.PorpoiseWebFilter;
import org.noear.solon.annotation.Component;
import org.noear.solon.annotation.Mapping;
import org.noear.solon.core.handle.Gateway;

/**
 * @author airhead
 */
@Mapping("/app-api/**")
@Component
public class AppGateway extends Gateway {
  @Override
  protected void register() {
    filter(0, new AppExceptionFilter());
    filter(10, new PorpoiseWebFilter());
    filter(30, new AppAuthFilter());

    // 添加Bean
    addBeans(bw -> "appApi".equals(bw.tag()));
  }
}
